home *** CD-ROM | disk | FTP | other *** search
/ Basic Press Kit / Basic Press Kit.iso / pc / progthis.dxr / 00022_ProgressThis scripts.ls < prev    next >
Encoding:
Text File  |  2001-10-11  |  2.5 KB  |  113 lines

  1. on progThis message, repeatNum, showButton, whichGUI
  2.   global gStillProgging, progWin
  3.   tell the stage
  4.     gStillProgging = 1
  5.   end tell
  6.   tell the stage
  7.     set the mouseDownScript to "dontPassEvent"
  8.   end tell
  9.   tell the stage
  10.     set the mouseUpScript to "dontPassEvent"
  11.   end tell
  12.   if (message = EMPTY) or voidp(message) then
  13.     message = "Progress..."
  14.   end if
  15.   if whichGUI = 2 then
  16.     go("PLAIN")
  17.   else
  18.     if whichGUI = 1 then
  19.       go("ZONE")
  20.     end if
  21.   end if
  22.   set the width of sprite 22 to 0
  23.   if not voidp(message) or not (message = EMPTY) then
  24.     if the number of chars in message > 34 then
  25.       repeat while the number of chars in message > 31
  26.         delete char -30000 of message
  27.       end repeat
  28.       theLastChar = the number of chars in message
  29.       put "..." after char theLastChar of message
  30.     end if
  31.   end if
  32.   if not voidp(message) or not (message = EMPTY) then
  33.     put message into field "Message"
  34.   end if
  35.   put repeatNum into field "repeatNum"
  36.   tell the stage
  37.     updateStage()
  38.   end tell
  39.   if showButton = 0 then
  40.     repeat with i = 2 to 4
  41.       set the visible of sprite i to 0
  42.       updateStage()
  43.     end repeat
  44.     set the visible of sprite 3 to 0
  45.     set the visible of sprite 7 to 0
  46.     set the visible of sprite 8 to 1
  47.     updateStage()
  48.     x = 304
  49.     y = 60
  50.     tell the stage
  51.       progWin.rect = getCenteredRect(x, y)
  52.     end tell
  53.   else
  54.     repeat with i = 2 to 5
  55.       set the visible of sprite i to 1
  56.       updateStage()
  57.     end repeat
  58.     set the visible of sprite 3 to 0
  59.     set the visible of sprite 7 to 1
  60.     set the visible of sprite 8 to 0
  61.     updateStage()
  62.     x = 304
  63.     y = 75
  64.     tell the stage
  65.       progWin.rect = getCenteredRect(x, y)
  66.     end tell
  67.   end if
  68.   tell the stage
  69.     open(progWin)
  70.   end tell
  71.   tell the stage
  72.     return EMPTY
  73.   end tell
  74. end
  75.  
  76. on progressBar theLoop
  77.   global progWin
  78.   if the rollover = 4 then
  79.     repeat while the mouseDown
  80.       if rollover(4) then
  81.         if the visible of sprite 3 = 0 then
  82.           set the visible of sprite 3 to 1
  83.         end if
  84.       else
  85.         if the visible of sprite 3 = 1 then
  86.           set the visible of sprite 3 to 0
  87.         end if
  88.       end if
  89.       updateStage()
  90.       theButton = the rollover
  91.     end repeat
  92.   else
  93.     if not (the rollover = 4) then
  94.       if the mouseDown then
  95.         beep()
  96.       end if
  97.       repeat while the mouseDown
  98.         nothing()
  99.       end repeat
  100.     end if
  101.   end if
  102.   if theButton = 4 then
  103.     tell the stage
  104.       return "CANCEL"
  105.     end tell
  106.   end if
  107.   updateStage()
  108.   progBar(theLoop)
  109.   tell the stage
  110.     updateStage()
  111.   end tell
  112. end
  113.